﻿package {
	import flash.display.MovieClip;
	import flash.net.ObjectEncoding;
	import flash.events.NetStatusEvent;
	import flash.events.*;
	import flash.display.*;
	import flash.display.LoaderInfo;
	import flash.display.Loader;
	import flash.system.*;
	import flash.text.TextField;

	public class flashVersion extends MovieClip {
		var version:String;
		
		public function flashVersion() {
			version = getVersion();
			if (version == "9"){
				txt_status.text = "Flash Player Version OK";
			}
		}
		
		
		//get flash player version
		function getVersion():String {
			var versionString:String = Capabilities.version;
			var pattern:RegExp = /^(\w*) (\d*),(\d*),(\d*),(\d*)$/;
			var result:Object = pattern.exec(versionString);
			if (result != null) {
				trace("input: " + result.input);
				trace("platform: " + result[1]);
				trace("majorVersion: " + result[2]);
				trace("minorVersion: " + result[3]);
				trace("buildNumber: " + result[4]);
				trace("internalBuildNumber: " + result[5]);
			} else {
				trace("Unable to match RegExp.");
			}
			return result[2];
		}



	}
}